package org.tang.stock;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;

public class TestKDJ {

	public static void main(String[] args) throws Exception {
		FileReader syzg = new FileReader(new File("D:\\table.csv"));
		BufferedReader buffer = new BufferedReader(syzg);
		ArrayList<Stock> stocks = new ArrayList<Stock>();
		String line = null;
		line = buffer.readLine();
		while ((line = buffer.readLine()) != null) {
			Stock tmp = new Stock(line);
			if (tmp.getVolume() != 0)
				stocks.add(tmp);
		}
		System.out.println("" + stocks.size());

		KDJ kdj = new KDJ(stocks);
		for (int i = kdj.getKdjs().length - 1; i > kdj.getKdjs().length - 3; i--) {
			System.out.println(kdj.getKdjs()[i]);
		}
	}

}
